/***********************************************/
/**			page_fault.s by doom119			   */
/**					May, 2010				   */
/***********************************************/
.global _page_fault
_page_fault:
	xchgl %eax, (%esp)
	pushl %ebx
	pushl %ecx
	pushl %edx
	pushl %edi
	pushl %esi
	pushl %ebp
	push %ds
	push %es
	push %fs
	movl $0x10, %edx
	mov %dx, %ds
	mov %dx, %es
	mov %dx, %fs
	mov %cr2, %edx
	pushl %edx
	testl $1, %eax
	jne 1f
	call do_no_page
	jmp 2f
1: 	call do_wp_page
2:	addl $4, %esp
	pop %fs
	pop %es
	pop %ds
	popl %ebp
	popl %esi
	popl %edi
	popl %edx
	popl %ecx
	popl %ebx
	popl %eax
	iret

